{% load static %}
<!DOCTYPE html>
<html lang = "en">
<head>
    <meta charset = "UTF-8">
    <title>AJAX局部刷新实例</title>
</head>
<body>
    <input type = "text" id="i1">+
    <input type = "text" id="i2">=
    <input type = "text" id="i3">
    <input type = "button" value="AJAX提交" id="b1">

<script src="{% static 'js/jquery-3.5.1.min.js' %}"></script>
    <script>
        $('#b1').on("click",function (){
            $.ajax({
                url:"{% url 'ajaxadd' %}",
                type:"get",
                data:{
                    "i1":$("#i1").val(),
                    "i2":$("#i2").val()
                },
                success:function (data){
                    $("#i3").val(data);
                }
            })
        })
    </script>


</body>
</html>